package com.bifang.common.constant.enums.common;

import java.awt.Color;

public enum QrcodeColorEnum {
    white("white", Color.WHITE),
    lightGray("lightGray", Color.LIGHT_GRAY),
    gray("gray", Color.GRAY),
    darkGray("darkGray", Color.DARK_GRAY),
    black("black", Color.BLACK),
    red("red", Color.RED),
    pink("pink", Color.PINK),
    orange("orange", Color.ORANGE),
    yellow("yellow", Color.YELLOW),
    green("green", Color.GREEN),
    magenta("magenta", Color.MAGENTA),
    cyan("cyan", Color.CYAN),
    blue("blue", Color.BLUE),
    gold("gold", new Color(205, 127, 50)),
    talentA("A", new Color(252, 154, 49)),
    talentB("B", new Color(249, 240, 45)),
    talentC("C", new Color(126, 97, 251)),
    talentD("D", new Color(5, 219, 244)),
    talentE("E", new Color(0, 120, 232)),
    talentF("F", new Color(90, 211, 99));
    private String type;
    private Color color;

    QrcodeColorEnum(String type, Color color) {
        this.type = type;
        this.color = color;
    }

    public String getType() {
        return this.type;
    }

    public Color getColor() {
        return this.color;
    }

    public static QrcodeColorEnum getByType(String type) {
        for (QrcodeColorEnum typeEnum : values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return null;
    }
}
